<template>
  <view class="container">
    <web-view :src="webSrc" @error="onEerror"></web-view>
  </view>
</template>

<script lang='ts'>
  import {
    Component,
    Vue
  } from 'vue-property-decorator'

  @Component({})
  export default class LinkPage extends Vue {
    webSrc: string = ""
    // 页面周期函数--监听页面加载
    onLoad(opition) {
      if (opition.src) {
        this.setData({
          webSrc: opition.src,
        });
      }
    }

    onEerror(e) {
      if (e.src) {
        wx.showToast({
          title: "页面解析失败"
        });
      }
    }
  }
</script>

<style lang="scss" scoped>
  .container {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
  }
</style>